<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Voro++: unitcell.hh Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Voro++
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript" src="dynsections.js"></script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">unitcell.hh</div>  </div>
</div>
<div class="contents">
<a href="unitcell_8hh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Voro++, a 3D cell-based Voronoi library</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// Author   : Chris H. Rycroft (LBL / UC Berkeley)</span>
<a name="l00004"></a>00004 <span class="comment">// Email    : chr@alum.mit.edu</span>
<a name="l00005"></a>00005 <span class="comment">// Date     : August 30th 2011</span>
<a name="l00006"></a>00006 <span class="comment"></span>
<a name="l00007"></a>00007 <span class="comment">/** \file unitcell.hh</span>
<a name="l00008"></a>00008 <span class="comment"> * \brief Header file for the unitcell class. */</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#ifndef VOROPP_UNITCELL_HH</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define VOROPP_UNITCELL_HH</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00014"></a>00014 <span class="keyword">using namespace </span>std;
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;<a class="code" href="config_8hh.html" title="Master configuration file for setting various compile-time options.">config.hh</a>&quot;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &quot;<a class="code" href="cell_8hh.html" title="Header file for the voronoicell and related classes.">cell.hh</a>&quot;</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="keyword">namespace </span>voro {
<a name="l00020"></a>00020 <span class="comment"></span>
<a name="l00021"></a>00021 <span class="comment">/** \brief Class for computation of the unit Voronoi cell associated with</span>
<a name="l00022"></a>00022 <span class="comment"> * a 3D non-rectangular periodic domain. */</span>
<a name="l00023"></a><a class="code" href="classvoro_1_1unitcell.html">00023</a> <span class="keyword">class </span><a class="code" href="classvoro_1_1unitcell.html" title="Class for computation of the unit Voronoi cell associated with a 3D non-rectangular periodic domain...">unitcell</a> {
<a name="l00024"></a>00024         <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00025"></a>00025 <span class="comment">                /** The x coordinate of the first vector defining the periodic</span>
<a name="l00026"></a>00026 <span class="comment">                 * domain. */</span>
<a name="l00027"></a><a class="code" href="classvoro_1_1unitcell.html#aba3ac9d30b539fb0017799555199c2df">00027</a>                 <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="classvoro_1_1unitcell.html#aba3ac9d30b539fb0017799555199c2df">bx</a>;<span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment">                /** The x coordinate of the second vector defining the periodic</span>
<a name="l00029"></a>00029 <span class="comment">                 * domain. */</span>
<a name="l00030"></a><a class="code" href="classvoro_1_1unitcell.html#a572a7b91539af3c0707b6caccbf15f35">00030</a>                 <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="classvoro_1_1unitcell.html#a572a7b91539af3c0707b6caccbf15f35">bxy</a>;<span class="comment"></span>
<a name="l00031"></a>00031 <span class="comment">                /** The y coordinate of the second vector defining the periodic</span>
<a name="l00032"></a>00032 <span class="comment">                 * domain. */</span>
<a name="l00033"></a><a class="code" href="classvoro_1_1unitcell.html#abaca9a0c853b9a53f164a2fbee783f83">00033</a>                 <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="classvoro_1_1unitcell.html#abaca9a0c853b9a53f164a2fbee783f83">by</a>;<span class="comment"></span>
<a name="l00034"></a>00034 <span class="comment">                /** The x coordinate of the third vector defining the periodic</span>
<a name="l00035"></a>00035 <span class="comment">                 * domain. */</span>
<a name="l00036"></a><a class="code" href="classvoro_1_1unitcell.html#a000adf05e666f0fb4f57dbe8ca5b51db">00036</a>                 <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="classvoro_1_1unitcell.html#a000adf05e666f0fb4f57dbe8ca5b51db">bxz</a>;<span class="comment"></span>
<a name="l00037"></a>00037 <span class="comment">                /** The y coordinate of the third vector defining the periodic</span>
<a name="l00038"></a>00038 <span class="comment">                 * domain. */</span>
<a name="l00039"></a><a class="code" href="classvoro_1_1unitcell.html#a434c1a7cd8ba84d4ad09845a1a0ddb5b">00039</a>                 <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="classvoro_1_1unitcell.html#a434c1a7cd8ba84d4ad09845a1a0ddb5b">byz</a>;<span class="comment"></span>
<a name="l00040"></a>00040 <span class="comment">                /** The z coordinate of the third vector defining the periodic</span>
<a name="l00041"></a>00041 <span class="comment">                 * domain. */</span>
<a name="l00042"></a><a class="code" href="classvoro_1_1unitcell.html#a30bf0a4a6bff808301aa424683eb0481">00042</a>                 <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="classvoro_1_1unitcell.html#a30bf0a4a6bff808301aa424683eb0481">bz</a>;<span class="comment"></span>
<a name="l00043"></a>00043 <span class="comment">                /** The computed unit Voronoi cell corresponding the given</span>
<a name="l00044"></a>00044 <span class="comment">                 * 3D non-rectangular periodic domain geometry. */</span>
<a name="l00045"></a><a class="code" href="classvoro_1_1unitcell.html#a0844f70778cc7b19024ed28a2c7ad02c">00045</a>                 <a class="code" href="classvoro_1_1voronoicell.html" title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a> <a class="code" href="classvoro_1_1unitcell.html#a0844f70778cc7b19024ed28a2c7ad02c">unit_voro</a>;
<a name="l00046"></a>00046                 <a class="code" href="classvoro_1_1unitcell.html" title="Class for computation of the unit Voronoi cell associated with a 3D non-rectangular periodic domain...">unitcell</a>(<span class="keywordtype">double</span> bx_,<span class="keywordtype">double</span> bxy_,<span class="keywordtype">double</span> by_,<span class="keywordtype">double</span> bxz_,<span class="keywordtype">double</span> byz_,<span class="keywordtype">double</span> bz_);<span class="comment"></span>
<a name="l00047"></a>00047 <span class="comment">                /** Draws an outline of the domain in Gnuplot format.</span>
<a name="l00048"></a>00048 <span class="comment">                 * \param[in] filename the filename to write to. */</span>
<a name="l00049"></a><a class="code" href="classvoro_1_1unitcell.html#a630c635fd21cdd4e50bab118a4dadb13">00049</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1unitcell.html#a630c635fd21cdd4e50bab118a4dadb13">draw_domain_gnuplot</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename) {
<a name="l00050"></a>00050                         FILE *fp(safe_fopen(filename,<span class="stringliteral">&quot;w&quot;</span>));
<a name="l00051"></a>00051                         draw_domain_gnuplot(fp);
<a name="l00052"></a>00052                         fclose(fp);
<a name="l00053"></a>00053                 }
<a name="l00054"></a>00054                 <span class="keywordtype">void</span> draw_domain_gnuplot(FILE *fp=stdout);<span class="comment"></span>
<a name="l00055"></a>00055 <span class="comment">                /** Draws an outline of the domain in Gnuplot format.</span>
<a name="l00056"></a>00056 <span class="comment">                 * \param[in] filename the filename to write to. */</span>
<a name="l00057"></a><a class="code" href="classvoro_1_1unitcell.html#af476fca3dcc658abe2796aa9613f67bc">00057</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1unitcell.html#af476fca3dcc658abe2796aa9613f67bc">draw_domain_pov</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename) {
<a name="l00058"></a>00058                         FILE *fp(safe_fopen(filename,<span class="stringliteral">&quot;w&quot;</span>));
<a name="l00059"></a>00059                         draw_domain_pov(fp);
<a name="l00060"></a>00060                         fclose(fp);
<a name="l00061"></a>00061                 }
<a name="l00062"></a>00062                 <span class="keywordtype">void</span> draw_domain_pov(FILE *fp=stdout);
<a name="l00063"></a>00063                 <span class="keywordtype">bool</span> intersects_image(<span class="keywordtype">double</span> dx,<span class="keywordtype">double</span> dy,<span class="keywordtype">double</span> dz,<span class="keywordtype">double</span> &amp;vol);
<a name="l00064"></a>00064                 <span class="keywordtype">void</span> images(vector&lt;int&gt; &amp;vi,vector&lt;double&gt; &amp;vd);
<a name="l00065"></a>00065         <span class="keyword">protected</span>:<span class="comment"></span>
<a name="l00066"></a>00066 <span class="comment">                /** The maximum y-coordinate that could possibly cut the</span>
<a name="l00067"></a>00067 <span class="comment">                 * computed unit Voronoi cell. */</span>
<a name="l00068"></a><a class="code" href="classvoro_1_1unitcell.html#a3f7cebe966d72935971c508fc64902f0">00068</a>                 <span class="keywordtype">double</span> <a class="code" href="classvoro_1_1unitcell.html#a3f7cebe966d72935971c508fc64902f0">max_uv_y</a>;<span class="comment"></span>
<a name="l00069"></a>00069 <span class="comment">                /** The maximum z-coordinate that could possibly cut the</span>
<a name="l00070"></a>00070 <span class="comment">                 * computed unit Voronoi cell. */</span>
<a name="l00071"></a><a class="code" href="classvoro_1_1unitcell.html#a3ac0618230ffa0a382469530f97844e6">00071</a>                 <span class="keywordtype">double</span> <a class="code" href="classvoro_1_1unitcell.html#a3ac0618230ffa0a382469530f97844e6">max_uv_z</a>;
<a name="l00072"></a>00072         <span class="keyword">private</span>:
<a name="l00073"></a>00073                 <span class="keyword">inline</span> <span class="keywordtype">void</span> unit_voro_apply(<span class="keywordtype">int</span> i,<span class="keywordtype">int</span> j,<span class="keywordtype">int</span> k);
<a name="l00074"></a>00074                 <span class="keywordtype">bool</span> unit_voro_intersect(<span class="keywordtype">int</span> l);
<a name="l00075"></a>00075                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> unit_voro_test(<span class="keywordtype">int</span> i,<span class="keywordtype">int</span> j,<span class="keywordtype">int</span> k);
<a name="l00076"></a>00076 };
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079 
<a name="l00080"></a>00080 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>


<hr class="footer"/><address class="footer"><small>
Generated on Fri Sep 23 2011 22:49:06 for Voro++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
